# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Phil Pirozhkov <pirjsuka@gmail.com>

pkgname=mtd-utils
pkgver=2.1.6
pkgrel=1
pkgdesc='Utilities for dealing with MTD devices'
url='http://www.linux-mtd.infradead.org/'
arch=('loong64' 'x86_64')
license=('GPL2')
depends=('lzo' 'util-linux' 'zstd' 'zlib')
makedepends=('cmocka')
source=(ftp://ftp.infradead.org/pub/mtd-utils/${pkgname}-${pkgver}.tar.bz2{,.asc})
sha512sums=('470902475b9e583d3a12801c1cab5492c671ec3ccf853cc3336c4e2b8771eac489d67b1414b9f1e827c42ebdba0fe2cdc681297477d67a796af04d81160442bd'
            'SKIP')
validpgpkeys=('13063F723C9E584AEACD5B9BBCE5DC3C741A02D1')

prepare() {
  cd ${pkgname}-${pkgver}
  autoreconf -fiv
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --libexecdir=/usr/lib \
    --sbindir=/usr/bin \
    --enable-unit-tests \
    --enable-tests
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check -j1
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
